package com.sanley.coronavirus.controller;

import com.sanley.coronavirus.entity.Inspect;
import com.sanley.coronavirus.service.InspectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
public class InspectController {
    @Autowired
    InspectService service;

    @GetMapping(value = "/inspect/get/{id}")
    public List<Inspect> get(@PathVariable("id")int id){

        return service.find(id);
    }

    @PostMapping(value="/inspect/add")
    public void add(@RequestBody Inspect Inspect)
    {
         service.add(Inspect);
    }

}
